FIND_PACKAGE( Boost REQUIRED )
FIND_PACKAGE( PkgConfig REQUIRED )
PKG_CHECK_MODULES( LIBSIGC REQUIRED sigc++-2.0 )
INCLUDE_DIRECTORIES( ${Boost_INCLUDE_DIRS} ${LIBSIGC_INCLUDE_DIRS} ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR} )
LINK_DIRECTORIES( ${Boost_LIBRARY_DIRS} )
ADD_LIBRARY( yenc SHARED yencoder.cpp ydecoder.cpp )
ADD_EXECUTABLE( ydecode ydec.cpp )
TARGET_LINK_LIBRARIES( yenc ${LIBSIGC_LIBRARY} boost_filesystem )
TARGET_LINK_LIBRARIES( ydecode yenc )
CONFIGURE_FILE( ${CMAKE_CURRENT_SOURCE_DIR}/libyenc.pc ${CMAKE_CURRENT_BINARY_DIR}/libyenc.pc ${CMAKE_INSTALL_PREFIX} @ONLY )
INSTALL( TARGETS yenc LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX}/lib )
INSTALL( FILES ydecoder.h DESTINATION ${CMAKE_INSTALL_PREFIX}/include )
INSTALL( FILES ${CMAKE_CURRENT_BINARY_DIR}/libyenc.pc DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/pkgconfig )
